<%@ page language="java" contentType="text/html"  pageEncoding="UTF-8"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html；charset=UTF-8">
<title>搜索</title>

<style type="text/css"> 
div { 
	position:absolute; 
	top:30%; 
	left:20%;
} 
</style> 
</head>
<body>
<script language="JavaScript">
function validSearch(){
	if (document.search.keyword.value == ""){
		document.search.keyword.focus();
		alert ("请输入搜索关键词！");
		return false;
	}
	
	if (document.search.catalog.value == "friend"){
		document.search.action="SearchFriendServlet";
	}
	
	if (document.search.catalog.value == "tutor"){
		document.search.action="SearchTutorServlet";
	}
	
	if (document.search.catalog.value == "project"){
		document.search.action="SearchProjectServlet";
	}
	
	if (document.search.catalog.value == "msg"){
		document.search.action="SearchMsgServlet";
	}
	
	if (document.search.catalog.value == "google"){
		document.location.href="http://www.google.com.hk/search?hl=zh-CN&source=hp&biw=1866&bih=1018&aq=f&aqi=&aql=&oq=&q="+document.search.keyword.value;
		return false;
	}
	
}
</script>
<!-- Hello! The time is now <%= new java.util.Date() %>-->
<div >  
<form name="search" method="get" onSubmit="return validSearch();">
	<table style="border: 1px solid #BBBBBB;background-color:#FFFFFF;width:600px;text-align:center" align="center" border="0" cellpadding="0" cellspacing="0">
		<tr><td nowrap style="padding-bottom:6px;padding-top:6px">
			LMB搜索引擎
			<input style="width:350px; height:25px" name="keyword" type="text" value="" 
				onMouseOver="this.focus()" onBlur="if (value ==''){value=''}" 
				onFocus="this.select()" onClick="if(this.value=='')this.value=''"> 
				<select style="width:77px;" name="catalog">
					<option value="friend">好友搜索</option>
					<option value="tutor">导师搜索</option>
					<option value="project">项目组搜索</option>
					<option value="msg">消息搜索</option>
					<option value="google">Google搜索</option>
				</select>
			<input style="line-height:130%;height:22px;width:39px" value="搜索" type="submit" name="submit">
			</td></tr>
	</table>
</form>
</div>

</body>
</html>